Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Video Channel Callback Functions

Sequence grabber components allow you to define a number of callback functions in your application. The sequence grabber calls your functions at specific points in the process of collecting, compressing, and displaying the source video data. By defining callback functions, you can control the process more precisely or customize the operation of the sequence grabber component.

For example, you could use a callback function to draw a frame number on each video frame as it is collected. You could use either a compress callback function or a grab-complete callback function to accomplish this. The compress callback function is called after each frame is collected, in order to compress the frame. The grab-complete callback function is called just before the compress callback function, as soon as the frame has been captured.

The SGSetVideoBottlenecks function lets you assign callback functions to a video channel. You can use the SGGetVideoBottlenecks function to determine the callback functions that have been assigned to a video channel.

The SGSetVideoBottlenecks function accepts a video bottlenecks structure that identifies the callback functions to be assigned to the channel. In addition, the SGGetVideoBottlenecks function contains a pointer to this structure.

The video bottlenecks structure is defined by the VideoBottles data type as follows:

struct VideoBottles {
    short                               procCount;              /* count of callbacks */
    GrabProc                            grabProc;               /* grab function */
    GrabCompleteProc                    grabCompleteProc;       /* grab-complete function */
    DisplayProc                         displayProc;            /* display function */
    CompressProc                        compressProc;           /* compress function */
    CompressCompleteProc                compressCompleteProc;
                                                                /* compress-complete
                                                                    function */
    AddFrameProc                        addFrameProc;           /* add-frame function */
    TransferFrameProc                   transferFrameProc;      /* transfer-frame function */
    GrabCompressCompleteProc            grabCompressCompleteProc;
                                                                /* grab-compress-complete
                                                                    function */
    DisplayCompressProc                 displayCompressProc;
                                                                /* display-compress
                                                                    function */
};
typedef struct VideoBottles VideoBottles;
procCount
Specifies the number of callback functions that may be identified in the structure. Set this field to 9.
grabProc
Identifies the grab function. If you are setting a grab function, set this field so that it points to the function's entry point. If you are not setting a grab function, set this field to nil .
grabCompleteProc
Identifies the grab-complete function. If you are setting a grab-complete function, set this field so that it points to the function's entry point. If you are not setting a grab-complete function, set this field to nil .
displayProc
Identifies the display function. If you are setting a display function, set this field so that it points to the function's entry point. If you are not setting a display function, set this field to nil .
compressProc
Identifies the compress function. If you are setting a compress function, set this field so that it points to the function's entry point. If you are not setting a compress function, set this field to nil .
compressCompleteProc
Identifies the compress-complete function. If you are setting a compress-complete function, set this field so that it points to the function's entry point. If you are not setting a compress-complete function, set this field to nil .
addFrameProc
Identifies the add-frame function. If you are setting an add-frame function, set this field so that it points to the function's entry point. If you are not setting an add-frame function, set this field to nil .
transferFrameProc
Identifies the transfer-frame function. If you are setting a transfer-frame function, set this field so that it points to the function's entry point. If you are not setting a transfer-frame function, set this field to nil .
grabCompressCompleteProc
Identifies the grab-compress-complete function. If you are setting a grab-compress-complete function, set this field so that it points to the function's entry point. If you are not setting a grab-compress-complete function, set this field to nil .
displayCompressProc
Identifies the display-compress function. If you are setting a display-compress function, set this field so that it points to the function's entry point. If you are not setting a display-compress function, set this field to nil .

SGSetVideoBottlenecks

The SGSetVideoBottlenecks function assigns callback functions to a video channel.

pascal ComponentResult SGSetVideoBottlenecks (SGChannel c,
                                          VideoBottles *vb);
c
Specifies the reference that identifies the channel for this operation. You obtain this reference from the SGNewChannel function, described on SGNewChannel .
vb
Contains a pointer to a video bottlenecks structure (defined by the VideoBottles data type). That structure identifies the callback functions to be assigned to this video channel. The video bottlenecks structure is described in Video Channel Callback Functions .

DESCRIPTION

The SGSetVideoBottlenecks function accepts a video bottlenecks structure that identifies the callback functions to be assigned to the channel.

SPECIAL CONSIDERATIONS

Your application should not call this function during a record or playback operation.

SGGetVideoBottlenecks

The SGGetVideoBottlenecks function allows you to determine the callback functions that have been assigned to a video channel.

pascal ComponentResult SGGetVideoBottlenecks (SGChannel c,
                                          VideoBottles *vb);
c
Specifies the reference that identifies the channel for this operation. You obtain this reference from the SGNewChannel function, described on SGNewChannel .
vb
Contains a pointer to a video bottlenecks structure, described in Video Channel Callback Functions . The SGGetVideoBottlenecks function sets the fields of that structure to indicate the callback functions that have been assigned to this video channel. You must set the procCount field in the video bottlenecks structure to 9.

SEE ALSO

You assign callback functions to a video channel by calling the SGSetVideoBottlenecks function, which is described in the previous section.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next